$(document).ready(function(){
	$(".nav ul li").each(function(i){
		$(this).click(function(){
			if(i!=0)$(".nav ul li span").css("left","45%");
			if(i==0)$(".nav ul li span").css("left","45%");
			$(this).attr("class","choice");
			$(this).siblings().attr("class","");
		});
	});
	
	
	$("#top form .select span").click(function(){
		var text1=$(this).siblings("p.selected").text();
		var id1=$(this).siblings("p.selected").attr("id");
		$("p.notselected").css({
			"display":"block",			
			"padding-top":"10px",
			"padding-bottom":"5px"
		});
		var text2=$(this).siblings("p.notselected").text();
		var id2=$(this).siblings("p.notselected").attr("id");
		$(this).siblings("p").css("cursor","pointer");
		var action;
		$("p.selected").click(function(){
			$("p.notselected").css({
			"display":"none"
			});
			$(this).css("cursor","default");
			
			
		});
		$("p.notselected").click(function(){

			$("p.selected").text(text2);
			$("p.selected").attr("id",id2);
			$(this).text(text1);
			$(this).attr("id",id1);
			$("p.notselected").css({"display":"none"});
			
			
		});
		$("#title").click(function(){
		        $("#searchType").attr("value","1");
		});
		$("#content").click(function(){
		        $("#searchType").attr("value","2");
		});        
	});
});